<!--
 * @FilePath     : /study_code/layui/6-4-8.html
 * @Description  : icon 配置层图标
 * @Date         : 2025-04-08 16:46:28
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-08 20:52:33
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <ul>
      <li><button id="btn0">按钮0</button></li>
      <li><button id="btn1">按钮1</button></li>
      <li><button id="btn2">按钮2</button></li>
      <li><button id="btn3">按钮3</button></li>
      <li><button id="btn4">按钮4</button></li>
      <li><button id="btn5">按钮5</button></li>
      <li><button id="btn6">按钮6</button></li>
    </ul>

    <hr />
    <ul id="tList" style="display: none"></ul>

    <script src="/layui/dist/layui.js"></script>
    <script>
      // type参数
      layui.use('layer', function () {
        var layer = layui.layer,
          $ = layui.$

        var html = ''
        for (var i = 0; i < 20; i++) {
          html +=
            '<li> 凑齐五个字，凑齐五个字，凑齐五个字，凑齐五个字，凑齐五个字，凑齐五个字，凑齐五个字，凑齐五个字，凑齐五个字，</li>'
        }
        $('#tList').append(html)

        /**
         * @brief: 设置信息框 & 加载层的图标
         * @key {*}
         * @value {number}
         * -1 不显示图标
         * 0 "黄色-叹号"图标
         * 1 "绿色-对号"图标
         * 2 "红色-叉号"图标
         * 3 "黄色-问号"图标
         * 4 "灰色-锁"图标
         * 5 "橙色-苦脸"图标
         * 6 "绿色-笑脸"图标
         */

        $('#btn0').on('click', function () {
          layer.msg('有表情的提示', { icon: -1 })
        })

        $('#btn1').on('click', function () {
          layer.msg('有表情的提示', { icon: 0 })
        })

        $('#btn2').on('click', function () {
          layer.msg('有表情的提示', { icon: 1 })
        })

        $('#btn3').on('click', function () {
          layer.msg('有表情的提示', { icon: 2 })
        })

        $('#btn4').on('click', function () {
          layer.msg('有表情的提示', { icon: 3 })
        })

        $('#btn5').on('click', function () {
          layer.msg('有表情的提示', { icon: 4 })
        })

        $('#btn6').on('click', function () {
          layer.msg('有表情的提示', { icon: 5 })
        })
      })
    </script>
  </body>
</html>
